package router;

import java.net.InetAddress;
import java.util.ArrayList;

public class NeighborTable {
	
	private ArrayList<NeighborDataStructure> data;
	
	public boolean hasEntry(NeighborDataStructure neighbor){
		return true; // TODO method stub
	}
	
	public void addEntry(NeighborDataStructure neighbor){
		
	}
	
	public ArrayList<NeighborDataStructure> getEntryForInterface(InetAddress interfaceID){
		
		ArrayList<NeighborDataStructure> returnArray = new ArrayList<NeighborDataStructure>();
		for (NeighborDataStructure neighbor : data) {
			
			if(neighbor.getAttachedInterface().equals(interfaceID)){
				returnArray.add(neighbor);
			}
			
		}
		return returnArray;
	}
	
	public ArrayList<NeighborDataStructure> getEntryForNeighbor(InetAddress neighborID){
		ArrayList<NeighborDataStructure> returnArray = new ArrayList<NeighborDataStructure>();
		
		for (NeighborDataStructure neighbor : data) {
			
			if(neighbor.getNeighborID().equals(neighborID)){
				returnArray.add(neighbor);
			}
			
		}
		return returnArray;
	}
	
	
	
	

}
